
<script type="text/javascript">

function submitForm(idForm){
	var result = tmt.validator.validateForm(idForm);
	if(result){
		document.forms[idForm].submit();
	}
}

function updateList(){
	var xhrO = getXmlHttpRequest2();
	xhrO.open("POST","<?php print url_for('clients/orphans')?>",false);
	xhrO.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhrO.setRequestHeader('X_REQUESTED_WITH','XMLHttpRequest');
	xhrO.send("class=<?php echo $className?>&ajax=true"); 
	document.getElementById('orphansTable').innerHTML = xhrO.responseText;
	$("a.fancy").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false,
		'titleShow'		: false
	});
}

function ignore(classname, id){
	if(confirm(__('Are you sure?'))){
		var xhrO = getXmlHttpRequest2();
		xhrO.open("POST","<?php print url_for('clients/ignoreOrphan')?>",false);
		xhrO.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xhrO.setRequestHeader('X_REQUESTED_WITH','XMLHttpRequest');
		xhrO.send("class=" + classname + "&id=" + id ); 
		updateList();
		
	}
}
</script>
<?php $hide = array();?>
<div id="orphansTable">
<?php include_partial('orphansList', array('records'=>$records, 'objDef' => $objDef, 'hide'=>$hide, 'className'=>$className));  ?>
</div>


<script type="text/javascript">
<!--

//-->

$("a.fancy").fancybox({
	'transitionIn'	:	'elastic',
	'transitionOut'	:	'elastic',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'overlayShow'	:	false,
	'titleShow'		: false
});


</script>

